package com.gossip.manager;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicBoolean;

import org.json.JSONException;

import com.gossip.GossipMember;
import com.gossip.GossipService;

public class FileSaver extends Thread implements Runnable {
	
	protected int _port = 2100;
	private AtomicBoolean _gossipServiceRunning;
	
	public FileSaver(int port)
	{
		this._port = port;
		this._gossipServiceRunning = new AtomicBoolean(true);
	}
    
	public void shutdown() {
		_gossipServiceRunning.set(false);
	}
	
	public void run() 
	{GossipService.info("The MemberListener process is started.");
	ServerSocket listener = null;
	try {
		listener = new ServerSocket(_port);
	} catch (IOException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}
	Socket server = null;
	// keep the main thread around
	while(_gossipServiceRunning.get()) {

		
	}
}
}
